<%@page import="db.dao.*"%>
<%@ page language="java" contentType="text/html;" import="java.util.*" pageEncoding="UTF-8" %>
<%
response.setContentType("text/html;charset=UTF-8");
request.setCharacterEncoding("UTF-8");
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
TeacherDAO tDao = new TeacherDAO();
Teacher tea = tDao.findById((String)session.getAttribute("username"));
TeaCourseDAO tcDao = new TeaCourseDAO();
TeaCourse tCourse = new TeaCourse();
List<TeaCourse> tcList = tcDao.findByProperty("id.teaid", (String)session.getAttribute("username"));
%>


<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>教务系统管理界面</title>
<link href='http://cdn.webfont.youziku.com/webfonts/nomal/104133/46121/594dd3a9f629d81270e07074.css' rel='stylesheet' type='text/css' />
<link href="css/jquery-accordion-menu.css" rel="stylesheet" type="text/css" />
<link href="css/font-awesome.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/stm.css" />

<style type="text/css">
*{box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;}
body{background:#3b424d;}
.content{width:260px;margin:20px auto;}
.filterinput{
	background-color:rgba(249, 244, 244, 0);
	border-radius:15px;
	width:90%;
	height:30px;
	border:thin solid #FFF;
	text-indent:0.5em;
	font-weight:bold;
	color:#FFF;
}
#demo-list a{
	overflow:hidden;
	text-overflow:ellipsis;
	-o-text-overflow:ellipsis;
	white-space:nowrap;
	width:100%;
}
</style>

<script src="js/jquery-1.11.2.min.js" type="text/javascript"></script>
<script src="js/jquery-accordion-menu.js" type="text/javascript"></script>
<script type="text/javascript">

$(function(){	
	//顶部导航切换
	$("#demo-list li").click(function(){
		$("#demo-list li.active").removeClass("active")
		$(this).addClass("active");
	})	
})	
</script>
</head>
<body>

<div class="content" style="float: left">
	<div id="jquery-accordion-menu" class="jquery-accordion-menu #313131" >
		<div class="jquery-accordion-menu-header" id="form"></div>
		<ul id="demo-list">
		 
		   <li class="active"><a href="http://www.cqut.edu.cn"><i class="fa fa-home"></i>前往学校首页 </a></li>
			<li><a href="#"><i class="fa fa-glass"></i>个人信息管理 </a>
				<ul	class="submenu">
					<li><a href="#" id="d1_1">查看个人信息 </a></li>
				</ul>
			</li>
			<li><a href="#"><i class="fa fa-file-image-o"></i>学生成绩管理 </a>
				<ul	class="submenu">
					<li><a href="#" id="d2_1">学生成绩登记 </a></li>
					<li><a href="#" id="d3_1">查看学生成绩 </a></li>
				</ul></li>
			<li><a href="#"><i class="fa fa-cog"></i>教务信息管理 </a>
				<ul class="submenu">
					<li><a href="#" id="d4_1">查看上课安排 </a></li>
					<li><a href="#" id="d5_1">查看带教课程 </a></li>
				</ul>
			</li>
			<li><a href="#"><i class="fa fa-home"></i>系统管理 </a>
                <ul class="submenu">
                    <li><a href="#" id="d6_1">密码修改 </a></li>
                </ul>
            </li>
			<li><a href="index.jsp"><i class="fa fa-user"></i>注销 </a></li>
		</ul>
		<div class="jquery-accordion-menu-footer">
			欢迎使用重庆理工大学教务系统
		</div>
	</div>
</div>

<div class="InfoDiv">
			<div class="d" id="d1_2" title="查看个人信息" align="center">
				<div>
					<h1 class="cssb7d2c1473196c5" style="font-size: 300%;  color: white;  padding-top: 20px; margin-top: 20px;">查看个人信息</h1>
				</div>
				<hr>
				<div style="width: 50%; min-width: 400px;">
					<form action="searchTeacher.action" method="post">
						<span class="fontawesome-user head">&nbsp;教师编号：</span>
						<input type="text" readonly value="&nbsp;&nbsp;<%=tea.getTeaid()%>"><br>
						<span class="fontawesome-user head">&nbsp;教师姓名：</span>
						<input type="text" readonly value="&nbsp;&nbsp;<%=tea.getTeaname()%>"><br >
						<span class="fontawesome-user head">&nbsp;教师性别：</span>
						<input type="text" readonly value="&nbsp;&nbsp;<%=tea.getTeasex()%>"><br>
						<span class="fontawesome-user head">&nbsp;身份证号：</span>
						<input type="text" readonly value="&nbsp;&nbsp;<%=tea.getTeaidentify()%>"><br>
						<span class="fontawesome-user head">&nbsp;入职学院：</span>
						<input type="text" readonly value="&nbsp;&nbsp;<%=tea.getDept().getDeptname() %>"><br>		
					</form>	
				</div>
			</div>
			<div class="d" id="d2_2" title="学生成绩登记" align="center">
				<div>
					<h1 class="cssb7d2c1473196c5" style="font-size: 300%;  color: white;  padding-top: 20px; margin-top: 20px;">学生成绩登记</h1>
				</div>
				<hr>
				<div style="width: 50%; min-width: 400px;">
					<form action="score.action" method="post">
						<span class="fontawesome-user head">&nbsp;选择课程：</span>
						<input type="text" value="" name="cid">
						<input type="submit" value="确定" name="score">
					</form>
				</div>
				</script>
			</div>
			<div class="d" id="d3_2" title="查看学生成绩" align="center">
				<div>
					<h1 class="cssb7d2c1473196c5" style="font-size: 300%;  color: white;  padding-top: 20px; margin-top: 20px;">查看学生成绩</h1>
				</div>
				<hr>
				<div style="width: 50%; min-width: 400px;">
					<form action="searchStuCourse.action" method="post">
						<span class="fontawesome-user head">&nbsp;查询方式：</span>
						<select name="stucourseOption">
							<option value="">--请选择--</option>
							<option value="studentid">按学生编号查询</option>
							<option value="studentname">按学生姓名查询</option>
							<option value="courseid">按课程编号查询</option>
							<option value="coursename">按课程名称查询</option>
						</select>
						<span class="fontawesome-user head">&nbsp;输入信息：</span>
						<input type="text" name="property">
						<input type="submit" value="确定" name="searchStuCourse">
					</form>
				</div>
			</div>
			<div class="d" id="d4_2" title="查看班级安排" align="center">
				<div>
					<h1 class="cssb7d2c1473196c5" style="font-size: 300%;  color: white;  padding-top: 20px; margin-top: 20px;">查看上课安排</h1>
				</div>
				<hr>
				<div style="width: 50%; min-width: 400px;">
					<form action="searchCourClass.action" method="post">
						<select name="courclassOption">
							<option value="">--请选择--</option>
							<option value="">按课程编号查询</option>
							<option value="">按课程名称查询</option>
							<option value="">查询全部</option>
						</select>
						<!-- <span class="fontawesome-user head">&nbsp;课程名称：</span>
						<span class="fontawesome-user head">&nbsp;课程编号：</span>
						<input type="text" name=""><br>
						<span class="fontawesome-user head">&nbsp;教授班级：</span> -->
						<input type="text" name="property">
						<input type="submit" value="确定" name="searchCourClass">
					</form>	
				</div>
			</div>
			<div class="d" id="d5_2" title="查看带教课程" align="center">
				<div>
					<h1 class="cssb7d2c1473196c5" style="font-size: 300%;  color: white;  padding-top: 20px; margin-top: 20px;">查看带教课程
					</h1>
				</div>
				<hr>
				<div style="width: 50%; min-width: 400px;">
				<table style="width:80%;color: whitesmoke;">
					<tr>
						<td>课程编号</td>
						<td>课程名称</td>
					</tr>
					<%
						Iterator<TeaCourse> iterator = tcList.iterator();
						TeaCourse temp = new TeaCourse();
						while(iterator.hasNext()){
							temp = iterator.next();
							%>
							<tr>
								<td><%=temp.getId().getCourseid() %></td>
								<td><%=temp.getCoursename() %></td>
							</tr>
						<%}
					 %>				
				</table>
						
				</div>
			</div>
			<div class="d" id="d6_2" title="密码修改" align="center">
				<div>
					<h1 class="cssb7d2c1473196c5" style="font-size: 300%;  color: white;  padding-top: 20px; margin-top: 20px;">密码修改</h1>
				</div>
				<hr>
				<div style="width: 50%; min-width: 400px;">
					<form action="updateTeacherPwd.action" method="post">
						<span class="fontawesome-user head">&nbsp;原&nbsp;&nbsp;&nbsp;密&nbsp;&nbsp;&nbsp;码：</span>
						<input type="password" name="pwd"><br>
						<span class="fontawesome-user head">&nbsp;密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：</span>
						<input type="password" name="pwd1">
						<span class="fontawesome-user head">&nbsp;确认密码：</span>
						<input type="password" name="pwd2">
						<input type="submit" value="确定" name="updateTeacherPwd">
					</form>	
				</div>
			</div>
			
</div>

<script type="text/javascript">
(function($) {
$.expr[":"].Contains = function(a, i, m) {
	return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase()) >= 0;
};
function filterList(header, list) {
	//@header 头部元素
	//@list 无需列表
	//创建一个搜素表单
	var form = $("<form>").attr({
		"class":"filterform",
		action:"#"
	}), input = $("<input>").attr({
		"class":"filterinput",
		type:"text"
	});
	$(form).append(input).appendTo(header);
	$(input).change(function() {
		var filter = $(this).val();
		if (filter) {
			$matches = $(list).find("a:Contains(" + filter + ")").parent();
			$("li", list).not($matches).slideUp();
			$matches.slideDown();
		} else {
			$(list).find("li").slideDown();
		}
		return false;
	}).keyup(function() {
		$(this).change();
	});
}
$(function() {
	filterList($("#form"), $("#demo-list"));
});
})(jQuery);	
</script>

<script type="text/javascript">

	jQuery("#jquery-accordion-menu").jqueryAccordionMenu();
	
</script>

<script type="text/javascript">
			$('#d1_1').click(function () {
				$('.d').hide();
				$('#d1_2').show();
			});
			$('#d2_1').click(function () {
				$('.d').hide();
				$('#d2_2').show();
			});
			$('#d3_1').click(function () {
				$('.d').hide();
				$('#d3_2').show();
			});
			$('#d4_1').click(function () {
				$('.d').hide();
				$('#d4_2').show();
			});
			$('#d5_1').click(function () {
				$('.d').hide();
				$('#d5_2').show();
			});
			$('#d6_1').click(function () {
				$('.d').hide();
				$('#d6_2').show();
			});
</script>

</body>
</html>
